package com.chart.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.poi.ss.formula.functions.T;

import java.util.Arrays;

@AllArgsConstructor
public enum  VouchersType {


    ONE_MONTH(1,1),
    THREE_MONTHS(2,3),
    ONE_YEAR(3,12),
    ONCE(4,0),
    UN_USED(0,0),
    USED(0,1);


    @Getter
    private Integer type;
    @Getter
    private Integer value;


    public static Integer parseValue (Integer type){
        return Arrays.stream(VouchersType.values()).filter(em -> em.type.equals(type)).findFirst().orElse(null).getValue();
    }

}
